import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
// 自动引入路由
const files = require.context('./routerList', true, /\.js$/)
const routes = files.keys().map(key => {
  const page = require('./routerList' + key.replace('.', ''))
  return page.default
})

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
